package com.dc.controller;


import com.dc.common.ResponseResultVO;
import com.dc.entity.WorkOrder;
import com.dc.entity.ro.StatisticalQueryRO;
import com.dc.entity.ro.assignRO;
import com.dc.entity.vo.DataCompletionRateVO;
import com.dc.entity.vo.DataDistributionVO;
import com.dc.entity.vo.WorkOrderDynamicsVO;
import com.dc.entity.vo.WorkOrderStatisticsVO;
import com.dc.ro.PageRO;
import com.dc.service.StatisticalQueryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "统计查询")
@RestController
@RequestMapping("/statisticalQuery")
public class StatisticalQueryController {

    @Resource
    private StatisticalQueryService statisticalQueryService;

    @ApiOperation(value = "H5-未完成工单整合查询", notes = "H5-未完成工单整合查询")
    @PostMapping("/selectIncompleteOrder")
    public ResponseResultVO<WorkOrder> selectIncompleteOrder(@RequestBody StatisticalQueryRO ro) {
        return statisticalQueryService.selectIncompleteOrder(ro);
    }

    @ApiOperation(value = "H5-工作台工单数量统计", notes = "H5-工作台工单数量统计")
    @PostMapping("/selectWorkbenchCount")
    public ResponseResultVO<WorkOrderStatisticsVO> selectWorkbenchCount(@RequestBody StatisticalQueryRO ro) {
        return statisticalQueryService.selectWorkbenchCount(ro);
    }

    @ApiOperation(value = "PC-工作台工单动态", notes = "PC-工作台工单动态")
    @PostMapping("/selectWorkOrderDynamics")
    public ResponseResultVO<WorkOrderDynamicsVO> selectWorkOrderDynamics(@RequestBody PageRO ro) {
        return statisticalQueryService.selectWorkOrderDynamics(ro);
    }

    @ApiOperation(value = "PC-通过id查询工单详情", notes = "PC-通过id查询工单详情")
    @GetMapping("/selectOrderDetailById")
    public ResponseResultVO selectOrderDetailByIdAndType(@RequestParam("id") String id) {
        return statisticalQueryService.selectOrderDetailByIdAndType(id);
    }

    @ApiOperation(value = "PC-工单数量分布/危险品分布", notes = "PC-工单数量分布/危险品分布")
    @GetMapping("/selectDataDistribution")
    public ResponseResultVO<DataDistributionVO> selectDataDistribution() {
        return statisticalQueryService.selectDataDistribution();
    }

    @ApiOperation(value = "PC-工作台顶部方块数据", notes = "PC-工作台顶部方块数据")
    @GetMapping("/selectDataCompletionRate")
    public ResponseResultVO<DataCompletionRateVO> selectDataCompletionRate() {
        return statisticalQueryService.selectDataCompletionRate();
    }

    @ApiOperation(value = "PC-工作台报警记录", notes = "PC-工作台报警记录")
    @PostMapping("/selectAlarmRecord")
    public ResponseResultVO<WorkOrder> selectAlarmRecord(@RequestBody PageRO ro) {
        return statisticalQueryService.selectAlarmRecord(ro);
    }

    @ApiOperation(value = "PC-指派功能", notes = "PC-指派功能")
    @PostMapping("/assignUser")
    public ResponseResultVO assignUser(@RequestBody assignRO ro) {
        return statisticalQueryService.assignUser(ro);
    }

    @ApiOperation(value = "PC-首页大屏实时统计", notes = "PC-首页大屏实时统计")
    @GetMapping("/realTimeStatistics")
    public ResponseResultVO realTimeStatistics() {
        return statisticalQueryService.realTimeStatistics();
    }

    @ApiOperation(value = "PC-系统状态", notes = "PC-系统状态")
    @GetMapping("/selectSystemState")
    public ResponseResultVO selectSystemState() {
        return statisticalQueryService.selectSystemState();
    }

    @ApiOperation(value = "PC-报警信息", notes = "PC-报警信息")
    @PostMapping("/selectAlarmInformation")
    public ResponseResultVO selectAlarmInformation(@RequestBody PageRO ro) {
        return statisticalQueryService.selectAlarmInformation(ro);
    }
}
